import React from 'react';

// 函数式组件使用 state
const UseStateCount = () => {

    const [count, setCount] = React.useState(0)

    const add = () => {
        setCount(count + 1)
    }

    return (
        <div>
            <h2>当前点赞数={count}</h2>
            <button onClick={add}>点赞</button>
        </div>
    );
}

export default UseStateCount
